<?php $menu_items = MenuItemTable::getInstance()->getItems(false) ?>
<div class="menu">
    <ul>
        <?php foreach($menu_items as $one) { ?>
        <li class="menu_item"><a target="<?php echo MenuItemTable::getTarget($one) ?>" href="<?php echo MenuItemTable::getLink($one) ?>"><?php echo $one['title'] ?></a>
            <?php $children = MenuItemTable::getInstance()->getItems($one['id']) ?>
            <?php if(count($children) > 0){ ?>
            <ul class="sub_menu">
                <?php foreach($children as $child) { ?>
                <li class="menu_item"><a title="<?php echo $child['title'] ?>" target="<?php echo MenuItemTable::getTarget($child) ?>" href="<?php echo MenuItemTable::getLink($child) ?>"><?php echo $child['title'] ?></a></li>
                <?php } ?>
            </ul>
            <?php } ?>
            </li>
        <?php } ?>
            <?php if(0){ ?><!--
        <li class="menu_item"><a href="<?php echo url_for('@homepage') ?>"><?php echo __('electronic gate') ?></a>
            <ul class="sub_menu">
                <li class="menu_item"><a title="<?php echo __('Login as Manager') ?>" href="<?php echo url_for('sf_guard_signin') ?>"><?php echo __('Login as Manager') ?></a></li>
                <li class="menu_item"><a title="<?php echo __('Login as Trainer') ?>" href="<?php echo url_for('trainer_login') ?>"><?php echo __('Login as Trainer') ?></a></li>
                <li class="menu_item"><a title="<?php echo __('Login as Teacher') ?>" href="<?php echo url_for('teacher_login') ?>"><?php echo __('Login as Teacher') ?></a></li>

            </ul>
        </li>
        <li class="menu_item"><a href="http://www.aljoufedu.gov.sa/vb/forumdisplay.php?f=42" target="_blank"><?php echo __('Forum') ?></a></li>
        <li class="menu_item"><a href="<?php echo url_for('@homepage') ?>"><?php echo __('Forms') ?></a></li>
        <li class="menu_item"><a href="<?php echo url_for('@homepage') ?>"><?php echo __('bags') ?></a></li>
        <li class="menu_item"><a href="<?php echo url_for('@homepage') ?>"><?php echo __('related sites') ?></a>
            <ul class="sub_menu">
                <li class="menu_item"><a href="www.moe.gov.sa" target="_blank"><?php echo __('moe gov') ?></a></li>
                <li class="menu_item"><a href="http://portal.moe.gov.sa/training/Pages/default.aspx" target="_blank"><?php echo __('training sub1') ?></a></li>
                <li class="menu_item"><a href="http://www.aljoufedu.gov.sa/" target="_blank"><?php echo __('aljoufedu.gov.sa') ?></a></li>
                <li class="menu_item"><a href="http://www.aljoufedu.gov.sa/vb/forumdisplay.php?f=42" target="_blank"><?php echo __('forumdisplay') ?></a></li>
                <li class="menu_item"><a href="www.ipa.edu.sa" target="_blank"><?php echo __('ipa.edu.sa') ?></a></li>
                <li class="menu_item"><a href="www.ju.edu.sa" target="_blank"><?php echo __('ju.edu.sa') ?></a></li>
                <li class="menu_item"><a href="www.mcs.gov.sa" target="_blank"><?php echo __('mcs.gov.sa') ?></a></li>
            </ul>
        </li>
        <li class="menu_item"><a href="<?php echo url_for('@homepage') ?>"><?php echo __('conditions') ?></a></li>
        <li class="menu_item"><a href="<?php echo url_for('@homepage') ?>"><?php echo __('certified trainers') ?></a>
            <ul class="sub_menu">
                <li class="menu_item"><a href="#"><?php echo __('certified trainers for disscu.') ?></a></li>
                <li class="menu_item"><a href="#"><?php echo __('centralized trainers') ?></a></li>
            </ul>
        </li>
        <li class="menu_item"><a href="<?php echo url_for('@homepage') ?>"><?php echo __('learning for future intel') ?></a></li>
        <li class="menu_item"><a href="<?php echo url_for('@homepage') ?>"><?php echo __('contact us') ?></a></li>
--> <?php } ?>   
    </ul>
</div>